#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, x, y;
    int dir[4][2] = {{0,  1},
                     {1,  0},
                     {0,  -1},
                     {-1, 0}};
    cin >> n;
    int arr[n + 5][n + 5];
    for (int i = 1; i <= ceil(n / 2.0); ++i) {
        x = i;
        y = i;
        for (auto &j: dir) {
            while (true) {
                arr[x][y] = i;
                int dx = x + j[0];
                int dy = y + j[1];
                if (dx < i or dx > n + 1 - i or dy < i or dy > n + 1 - i)
                    break;
                x += j[0];
                y += j[1];
            }
        }
    }
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= n; ++j)
            cout << arr[i][j] << ' ';
        cout << endl;
    }
    return 0;
}